Skip to content

Conversation

@cr0ybot
Copy link

@cr0ybot cr0ybot commented Sep 16, 2025

Description of the Change

This PR allows for control over whether the search results in the ContentSearch component should include embeddings in the response via the new includeEmbeds prop and passes that embedded object through the NormalizedSearchResults to the renderItem and renderItemType functions.

This allows for greater customization of the search results than what is currently provided in the normalized results without needing to perform additional API requests. This allows any standard field included in an embedded response to be used, enabling things like showing the publish date for instance.

The ContentSearch and ContentPicker components have been updated to accept the includeEmbeds prop, as well as the QueryArgs interface. Both the content-search-example and content-picker-example blocks have been updated to demonstrate result customization.

Here is the content search example that has been updated to include the post date:

Screenshot 2025-09-15 at 1 57 33 PM

Note that _embed: true is currently part of the post search query but the embeds are not passed through, both because normalizeResults does not currently process it but also because the fields requested don't allow for _links and _embedded in the response. This change controls both of these aspects, and by default does not include embeds.

Closes #395

How to test the Change

  1. Verify that both the content search and content picker example blocks display publish date under the type label
  2. Verify that both components work as they did before the change when includeEmbeds is not passed

Changelog Entry

Added - New includeEmbeds prop for ContentSearch and ContentPicker components

Credits

Props @cr0ybot

Checklist:

I'm opening the PR for review because I'm admittedly new to cypress and I'm not sure how to run the integration tests, but the tests have been updated (I don't think they would have been working before).

@cr0ybot cr0ybot marked this pull request as ready for review September 16, 2025 14:06
@cr0ybot
Copy link
Author

cr0ybot commented Sep 29, 2025

I've synced the branch with develop, let me know if there's anything else I need to do to have this considered for inclusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Content Search result customizability

1 participant